home *** CD-ROM | disk | FTP | other *** search
- #include <dirent.h>
- #include <stdio.h>
-
- _main(int argc, char **argv)
- {
- int loop = 1;
- DIR *f = opendir(".");
- do
- {
- struct dirent *buf = readdir(f);
- if (buf)
- {
- printf("Entry no = %d ", buf->d_fileno); /* file number of entry */
- printf("Length = %d ", buf->d_reclen); /* length of this record */
- printf("name length %d ", buf->d_namlen); /* length of string in d_name */
- printf("name %s\n", buf->d_name);
- fflush(stdout);
- }
- else loop = 0;
- }
- while (loop);
- closedir(f);
- }
-